// 泛型也可以与生命周期参数一起使用：
fn longest<'a, T>(x: &'a T, y: &'a T) -> &'a T
    where
        T: PartialOrd + ?Sized,
{
    if x > y {
        x
    } else {
        y
    }
}

#[test]
fn test_generic_lifetime(){
    let x = "abc";
    let y = "edfg";
    let longest1 = longest(x,y);  //没有为 `str` 实现特征 `Sized`
    println!("{}", longest1);
}